import { http } from "@/utils/http";
import type { HttpResult } from "@/utils/http/types";

export function listDicData(url: string, params?: object) {
  return http.request<HttpResult>("post", url, {
    data: params
  });
}

export function listDicUrl(url: string) {
  return http.request<HttpResult>("get", url);
}

export function sendSmsCode(params: object) {
  return http.request<HttpResult>("get", "/code/sms", {
    params: params
  });
}

export function sendSmsMessage(params: object) {
  return http.request<HttpResult>("post", "/admin/sms/send", {
    data: params
  });
}

export function validSmsCode(params: object) {
  return http.request<HttpResult>("get", "/code/sms/valid", {
    params: params
  });
}

export function api(url: string, params: object) {
  return http.request<HttpResult>("get", url, {
    params: params
  });
}
